﻿using System;

namespace Jinndev.UI {

    public class UIParam {

        /// <summary>
        /// 是否模态，即点击是否可以穿透背景
        /// </summary>
        public bool modal = false;

        /// <summary>
        /// 是否带背景遮罩层
        /// </summary>
        public bool mask = false;

        /// <summary>
        /// 点击背景是否关闭(destroyOnClickBackground)
        /// </summary>
        public bool docb = false;

        /// <summary>
        /// 是否遮挡后面的UI，如果是，在创建时会deactive后面的UI，在销毁时会恢复后面的UI
        /// </summary>
        public bool block = false;


        public static UIParam Modal {
            get { return new UIParam { modal = true }; }
        }

        public static UIParam Block {
            get { return new UIParam { block = true }; }
        }

        public static UIParam ModalMask {
            get { return new UIParam { modal = true, mask = true }; }
        }

        public static UIParam ModalBlock {
            get { return new UIParam { modal = true, block = true }; }
        }

        public static UIParam BlockMask {
            get { return new UIParam { block = true, mask = true }; }
        }

        public static UIParam ModalBlockMask {
            get { return new UIParam { modal = true, block = true, mask = true }; }
        }

        /// <summary>全屏界面，隐藏后面</summary>
        public static UIParam FullScreen {
            get { return new UIParam { modal = true, block = true }; }
        }

        /// <summary>模态面板，不隐藏后面、有背景遮罩、点背景关闭</summary>
        public static UIParam ModalPanel {
            get { return new UIParam { modal = true, mask = true, docb = true }; }
        }

    }

}
